<%@ page contentType="text/html;charset=utf-8" 
	import="com.zh.UserBean,org.springframework.web.context.*,org.springframework.web.context.support.*,com.zh.Util,java.util.*,com.zh.User,com.zh.House"
%>
<html>
  <head>
    <title>添加缴费信息</title>
     <script language="JavaScript" src="script/com.js"></script>
     <script language="JavaScript">
       function check(){
       	 var username=document.all.username.value;
       	 var starttime=document.all.starttime.value;
       	 var endtime=document.all.endtime.value;
       	 var stopcarmoney=document.all.stopcarmoney.value;
       	 var watermoney=document.all.watermoney.value;
       	 var elementmoney=document.all.elementmoney.value;
       	 var gasmoney=document.all.gasmoney.value;
       	 var servicemanagemoney=document.all.servicemanagemoney.value;
       	 if(username.trim()==""){
       	   alert("姓名不能为空");
		    return;
       	 }
       	  if(starttime.trim()==""){
       	   alert("开始时间不能为空");
		    return;
       	 }
       	  if( endtime.trim()==""){
       	   alert("截止时间不能为空");
		    return;
       	 }
       	  if(stopcarmoney.trim()==""){
       	   alert("停车费不能为空");
		    return;
       	 }
       	  if(watermoney.trim()==""){
       	   alert("水费不能为空");
		    return;
       	 }
       	  if(elementmoney.trim()==""){
       	   alert("电费不能为空");
		    return;
       	 }
       	  if(gasmoney.trim()==""){
       	   alert("煤气费不能为空");
		    return;
       	 }
       	  if(servicemanagemoney.trim()==""){
       	   alert("物管费不能为空");
		    return;
       	 }
       	 document.all.ss.submit();
       }
     </script>
      <style>
	       table{
	         border-collapse:collapse;
	       }
	       table,tr,td {
	       
	       border:1px solid black;
	       }
	       .mima {
	       width:100%;
	       height:40px;
	       background-color:#ADD8E6;
	       }
	       .zi {
	       font-size:20px;
	       position:relative;
	       left:45%;
	       margin-left:-30px;
	       line-height:40px;
	       }
	</style>
  </head>
  <body>
 	<jsp:useBean id="userBean" class="com.zh.UserBean" scope="session"/>
	<div class="mima"><font class="zi">添加收费信息</font></div>
	<form action="SuperServlet" method="post" id="ss">
	<table  width="80%" border="1" cellspacing="0" style="margin-left:150px;margin-top:15px">	
	  <tr>
	    <td align="right" width="40%" height="30px">业户姓名:</td>
	    <td>
      	  <select name="username">
      	  <% 
			//获取WebApplicationContext
			WebApplicationContext wac=
			   WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
			Util db = (Util)wac.getBean("Util");
			List<String> nameList = db.getUserName();

			for(String name:nameList){

      	    %>
      	    	<option value="<%= name %>" ><%= name %></option>
      	    <%
      	    	}
      	     %>
      	  </select>
	  	</td>
	  </tr>
	  <tr >
	  	<td align="right" height="30px">开始时间:</td>
	  	<td><input type="date" name="starttime" id="starttime"/></td>
	  </tr>
	  <tr >
	  	<td align="right" height="30px">截止时间:</td>
	  	<td><input type="date" name="endtime" id="endtime" /></td>
	  </tr>
	  <tr >
	    <td align="right" height="30px">停车费:</td>
	    <td><input name="stopcarmoney" id="stopcarmoney" /></td>
	  </tr>
	  
	  <tr >
	  	<td align="right" height="30px">水费:</td>
	  	<td><input name="watermoney" id="watermoney" /></td>
	  </tr>	 
	  <tr b>
	  	<td align="right" height="30px">电费:</td>
	  	<td><input name="elementmoney" id="elementmoney" /></td>
	  </tr>
	  <tr >
	  	<td align="right" height="30px">煤气费:</td>
	  	<td><input name="gasmoney" id="gasmoney" /></td>
	  </tr>	
	  <tr >
	  	<td align="right" height="30px">服务费:</td>
	  	<td><input name="servicemanagemoney" id="servicemanagemoney" /></td>
	  </tr>	
	  <tr >
	  	<td align="right" height="30px">缴费状态:</td>
	  	<td>
	  		<select name="states">     	  
      	    	<option value="未缴费">未缴费</option>
      	    	<option value="已缴费">已缴费</option>     	   
      	  </select>
	  	</td>
	  </tr>
	  
	    <tr height="30px" >
		   <td  colspan="2">
		   <div  style="position:relative;left:40%;">
		   <input type="button" value="提交" id="xg" onclick="JavaScript:check()" style="cursor:hand"/>
		   <input type="button" value="重置" id="cz" onclick="JavaScript:document.all.ss.reset()"  style="cursor:hand">
		   </div>
		   </td>
		 </tr>
	</table>
	<input type="hidden" name="action" value="addpay"/>
	
	
	</form>
  </body>
</html>